# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=libappindicator
pkgver=12.10.1_p20200706
_pkgver=${pkgver%_p*}+20.10.${pkgver#*_p}.1
pkgrel=0
pkgdesc="Library that allow applications to export menus"
url="https://launchpad.net/libappindicator"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	autoconf
	automake
	dbus-glib-dev
	glib-dev
	glib-networking
	gobject-introspection-dev
	gtk+3.0-dev
	libdbusmenu-glib-dev
	libdbusmenu-gtk3-dev
	vala
	"
checkdepends="dbus-test-runner xvfb-run bash"
subpackages="$pkgname-dev"
source="libappindicator-$pkgver.tar.gz::https://launchpad.net/ubuntu/+archive/primary/+files/libappindicator_$_pkgver.orig.tar.gz
	no-gtk-doc-make.patch
	improved-plasma.patch
	"
builddir="$srcdir"
options="!check" # tests are unreliable

prepare() {
	default_prepare
	autoreconf -vfi
}

build() {
	export CFLAGS="$CFLAGS -Wno-error"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-introspection \
		--disable-gtk-doc-html \
		--disable-mono-test \
		--disable-static \
		--with-gtk=3
	make
}

check() {
	G_MESSAGES_DEBUG=all make check
}

package() {
	make -j1 DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/usr/share/gtk-doc
}

sha512sums="
cc60875b1c4ab06348eece442a59a4057d7e13f25605435902242558e8dd5e66aeeee6725b9bd2662ef89052d3614dc4577ed8c233e9b84236a75e771aa67352  libappindicator-12.10.1_p20200706.tar.gz
6cb1f16b41339a4540fc21858856729b403f4cffcb6c87bad66d5cc4a27e4b8146419f05e323bd62327b6cdf9621ac106a6b09e248248051a03bbf48700a0f3c  no-gtk-doc-make.patch
ad6ea22b383ac527d5cd018d8bf97ec899d667979d866ea20a9e08d4e6000850498d3a04b934a61d9ce4a2c4ac1ad9b5376c71a5839876a89672a28d8f18a22f  improved-plasma.patch
"
